#ifndef AVALON_DESERIALIZER_HPP
#define AVALON_DESERIALIZER_HPP
#include <vector>
#include "Avalon/Serialization/DataShuttle.hpp"
#include "Avalon/Serialization/Serialization.hpp"

namespace Avalon {
namespace Serialization {

  /*! \class Deserializer
   *  \brief Base class for a DataShuttle that loads data.
   *  \author Kamal Mansouri <kranar@hotmail.com>
   */
  class Deserializer : public DataShuttle {
    public:

      virtual ~Deserializer();

      //! Sets the source of the data to load.
      /*!
        \param source The source of the data to load.
        \param size The size in bytes of the <i>source</i> data.
      */
      virtual void SetDataSource(const void* source, int size) = 0;

      virtual bool IsReceiving();

      using DataShuttle::Shuttle;

    private:
      friend class DataShuttle;
      std::vector<ConstructorType> m_constructors;
      std::vector<SharedConstructorType> m_sharedConstructors;

      virtual ConstructorType FindConstructor();
      virtual SharedConstructorType FindSharedConstructor();
  };
}
}

#endif // AVALON_DESERIALIZER_HPP
